<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>回顾</title>
</head>
<body>
  <div id="app">
    <!-- <prolist></prolist> -->
    <prolist />
    <prolist />
    <prolist />
  </div>
</body>
<template id="prolist">
  <ul>
    <li v-for="item of list" :key="item.id">
      {{ item.title }}
    </li>
  </ul>
</template>
<script src="vue.js"></script>
<script src="axios.min.js"></script>
<script>
  const Prolist = {
    template: '#prolist',
    data () { // 为什么data必须是函数 https://cn.vuejs.org/v2/api/#data
      // 如果组件被多次引用，使用对象会相互影响，使用函数是独立的
      return {
        list: []
      }
    },
    mounted () {
      // axios.get('https://www.daxunxun.com/douban').then(res => {
      //   console.log(res.data)
      //   this.list = res.data
      // })
      fetch('https://www.daxunxun.com/douban').then(res => res.json()).then(data => {
        console.log(data)
        this.list = data
      })
    }
  }

  new Vue({
    el: '#app',
    data: {},
    methods: {},
    computed: {},
    watch: {},
    mounted () {},
    components: {
      prolist: Prolist
    }
  })
</script>
</html>